package com.back.controller.mqdemo;


import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/all")
public class prodictController {


    @Autowired
    private RabbitTemplate rabbitTemplate;

    @GetMapping("/test")
    public String test01(String name){
        rabbitTemplate.convertAndSend("exchange01","queue01",name);
        return name+"123";
    }

}
